﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CanvasEx.DrawCore
{
    class DrawPolyLine: DrawObject
    {
        List<Point> pointlist = new List<Point>();
        PathFigure pathfigure = new PathFigure();
        PolyLineSegment polylinesegment = new PolyLineSegment();
        PathGeometry pathgeometry = new PathGeometry();

        public DrawPolyLine(Painter p, List<Point> pointlist)
            : base(p)
        {
            this.pointlist = pointlist;
            polylinesegment = new PolyLineSegment(pointlist, true);
            pathfigure.Segments.Add(polylinesegment);
            pathgeometry.Figures.Add(pathfigure);
        }


        public override Geometry GetGeometry()
        {
            return pathgeometry;
        }
        public override bool InGraph(Point Location, double SelectAccuracy)
        {
            return false;
        }

        public override List<Point> GetHotSpot()
        {
            return pointlist;
        }

    }
}
